package com.lecture.java8.datastructure;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Stack;

/**
 * @author luyn
 * @version 1.0
 * @description
 * @date 2021/3/29 16:40
 */
public class Demo8 {

    public static void main(String[] args) {
        //cal(3);
        //f1(8);
        //stackFun("2*(6/3+4)-5");
        System.out.println(-91 >>> 1);
    }

    public static void cal(int n) {
        int ret = 0;
        for (int i = 1; i < n; i++) {
            ret = ret +f(n);
        }
        System.out.println(ret);
    }

    public static int f(int n) {
        int sum = 0;
        for (int i = 1; i < n; i++) {
            System.out.println("执行了第{"+i+"}遍");
            sum = sum + i;
        }
        return sum;
    }

    public static void f1(int n) {
        for (int i = 1; i <= n; i++) {
            System.out.println("第{"+i+"}遍");
            i = i * 2;
        }
    }

    public static void stackFun(String str) {
        for (int i = 0; i < str.length(); i++) {
            switch (str.charAt(i)) {
                case '-':
                case '+':

                    break;
                case '*':
                case '/':
                    break;
                case '(':
                    break;
                case ')':
                    break;
            }
        }
    }

    /***
     * @description
     * @author luyn
     * @date 2021/3/29 20:45
     * @param opThis 当前元素
     * @param prce1 运算符大小
     * @return void
    **/
    public static void gotOper(char opThis, int prce1) {}
}
